//
//  YsSmartPenBindCell.m
//  Pods-YsSmartPenModule_Example
//
//  Created by Cer on 2020/4/23.
//

#import "YsSmartPenBindCell.h"
#import "YsSmartPenHelper.h"
#import <YYKit/YYKit.h>
#import <Masonry/Masonry.h>

@implementation YsSmartPenBindCell

- (void)initSubviews
{
    
    self.contentView.backgroundColor = [UIColor colorWithHexString:@"f2f2f7"];
    UIView *innerView = [[UIView alloc] init];
    innerView.backgroundColor = UIColor.whiteColor;
    innerView.layer.cornerRadius = 10;
    [self.contentView addSubview:innerView];
    
    [innerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.bottom.mas_equalTo(0);
    }];
    
    
    YYLabel *label = [[YYLabel alloc] init];
    [innerView addSubview:label];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.mas_equalTo(0);
    }];
    NSMutableAttributedString *textStr = [[NSMutableAttributedString alloc] initWithString:@"    添加设备"];
    textStr.color = [UIColor colorWithHexString:@"#FF6B20"];
    textStr.font = [UIFont boldSystemFontOfSize:15];
    
    NSMutableAttributedString *attachment = nil;
    UIImage *image = [YsSmartPenHelper imageWithName:@"state_leaveLine"];
    attachment = [NSMutableAttributedString attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:image.size alignToFont:[UIFont systemFontOfSize:16] alignment:YYTextVerticalAlignmentCenter];
    [textStr insertAttributedString:[attachment copy] atIndex:0];
    label.attributedText = textStr;
}

- (void)initClicks
{
    
}
@end
